package com.ftg.learn.mapper;

import com.ftg.learn.domain.StudentDomain;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 表示把当前这个接口做为sprnigboot的一个mapper接口，把生成的实现类添加到springboot的容器里面
 */
@Mapper
public interface StudentMapper {

    List<StudentDomain> showAll(@Param("sname") String name, @Param("ssex") String sex,@Param("start") Integer start,@Param("limit") Integer limit);

    Integer count(@Param("sname") String name, @Param("ssex") String sex);


    @Insert("insert into student(sno,sname,sage,ssex) values(#{sno},#{sname},#{sage},#{ssex})")
    int insert(StudentDomain studentDomain);

    @Select("select * from student where sno = #{sno}")
    StudentDomain checkSno(@Param("sno") String sno);

}
